import request from '@/config/axios'

export interface ActivityVO {
  id: number
  activityName: string
  activityLevel: number
  peopleNumber: number
  studentName: string
  majorClass: string
  instructor: string
  awardDate: Date
  remark: string
  status: number
  reason: string
}

// 查询学术活动列表
export const getActivityPage = async (params) => {
  return await request.get({ url: `/data/activity/page`, params })
}

// 查询学术活动详情
export const getActivity = async (id: number) => {
  return await request.get({ url: `/data/activity/get?id=` + id })
}

// 新增学术活动
export const createActivity = async (data: ActivityVO) => {
  return await request.post({ url: `/data/activity/create`, data })
}

// 修改学术活动
export const updateActivity = async (data: ActivityVO) => {
  return await request.put({ url: `/data/activity/update`, data })
}

// 修改学术活动
export const updateActivityStatus = async (data: ActivityVO) => {
  return await request.put({ url: `/data/activity/updateStatus`, data })
}

// 删除学术活动
export const deleteActivity = async (id: number) => {
  return await request.delete({ url: `/data/activity/delete?id=` + id })
}

// 导出学术活动 Excel
export const exportActivity = async (params) => {
  return await request.download({ url: `/data/activity/export-excel`, params })
}
